<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>系统岗位修改</title>
    <link id="easyuiTheme" href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
    <link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
    <link href="../../static/css/esaas-easyui-add.css" rel="stylesheet" type="text/css"/>
    <script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
    <script src="../../static/easyui/jquery.cookie.js" type="text/javascript"></script>
    <script src="../../static/easyui/ui-theme.js" type="text/javascript"></script>
    <script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
    <script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
    <script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
    <script src="../../ffres/dict/all.js" type="text/javascript"></script>
    <a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<body class="easyui-layout">
<form id="ff" method="post">
    <div class="esaas-info-title">系统岗位信息</div>
    <table class="esaas-info-add-table">
        <tr>
            <td width="15%" align="right">岗位代码：</td>
            <td width="35%"><input class="easyui-textbox" type="text"
                                   name="dutyCode" data-options="required:true"
                                   style="width: 100%; height: 25px;"></input></td>
            <td width="15%" align="right">岗位名称：</td>
            <td width="35%"><input class="easyui-textbox" type="text"
                                   name="dutyName" data-options="required:true"
                                   style="width: 100%; height: 25px;"></input></td>
        </tr>
        <tr>
            <td width="15%" align="right">机构法人代码：</td>
            <td width="35%"><input class="easyui-textbox" type="text"
                                   name="legalOrgCode" data-options="required:false"
                                   style="width: 100%; height: 25px;"></input></td>
            <td width="15%" align="right">组织号：</td>
            <td width="35%"><input class="easyui-textbox" type="text"
                                   name="orgId" data-options="required:false"
                                   style="width: 100%; height: 25px;"></input></td>
        </tr>
        </tr>
        <tr>
            <td width="15%" align="right">类型：</td>
            <td width="35%"><input class="easyui-textbox" type="text"
                                   name="dutyType" data-options="required:false"
                                   style="width: 100%; height: 25px;"></input></td>
            <td width="15%" align="right">岗位层级：</td>
            <td width="35%"><input class="easyui-textbox" type="text"
                                   name="dutyLevel" data-options="required:false"
                                   style="width: 100%; height: 25px;"></input></td>

        <tr>
            <td width="15%" align="right">上级岗位号：</td>
            <td width="35%"><input class="easyui-textbox" type="text"
                                   name="dutyParentCode" data-options="required:false"
                                   style="width: 100%; height: 25px;"></input></td>
            <td width="15%" align="right">机构代码：</td>
            <td width="35%"><input class="easyui-textbox" type="text"
                                   name="orgCode" data-options="required:false"
                                   style="width: 100%; height: 25px;"></input></td>
        </tr>
        <tr>
            <td width="15%" align="right">备注：</td>
            <td width="100%" colspan="3"><input class="easyui-textbox" type="text"
                                                name="memo" data-options="required:false, multiline: true"
                                                style="width: 100%; height: 50px;"></input></td>
        </tr>
    </table>
</form>
<!--<div style="text-align: center; padding: 15px">-->
    <!--<a href="javascript:void(0)" class="easyui-linkbutton"-->
       <!--onclick="submitForm()">&nbsp;保&nbsp;存&nbsp;</a> <a-->
        <!--href="javascript:void(0)" class="easyui-linkbutton"-->
        <!--onclick="closeForm()">&nbsp;关&nbsp;闭&nbsp;</a>-->
<!--</div>-->
<div class="esaas-info-buttons">
    <a href="javascript:void(0)" class="easyui-linkbutton " iconCls="icon-ok" onclick="submitForm()" style="width:90px">&nbsp;保&nbsp;存&nbsp;</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="closeForm()" style="width:90px">&nbsp;关&nbsp;闭&nbsp;</a>
</div>
<script>
    $(function() {
        addTitle("修改")
        var dutyCode = $.getUrlParam('dutyCode');
        $.restfulGet('../../api/s/duty/' + dutyCode,null,function(data){
            $('#ff').form('load', {
                dutyCode : data.rows.dutyCode,
                dutyName : data.rows.dutyName,
                legalOrgCode : data.rows.legalOrgCode,
                memo : data.rows.memo,
                dutyType : data.rows.dutyType,
                orgId : data.rows.orgId,
                orgCode:data.rows.orgCode,
                dutyLevel : data.rows.dutyLevel,
                dutyParentCode : data.rows.dutyParentCode
            });
        });
    });

    function submitForm() {
        if (!$('#ff').form('validate'))
            return;
        var jsonData = $("#ff").serializeJson();
        $.restfulPut('../../api/s/duty', jsonData, function(data) {
            window.parent.reloadList();
        });
    };

    function closeForm(){
        window.parent.JLEUtil.closewin();
    }
</script>
</body>
</html>